package com.dikang.yygh.msm.service.impl;

import com.dikang.yygh.msm.utils.CloopenSmsUtil;
import com.dikang.yygh.msm.service.MsmService;
import com.dikang.yygh.vo.msm.MsmVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

@Service
public class MsmServiceImpl implements MsmService {
    @Override
    public boolean send(String phone, String code) {
        return CloopenSmsUtil.sent(phone, code);
    }
    @Override
    public boolean send(MsmVo msmVo){
        System.out.println(msmVo);
        if(!StringUtils.isEmpty(msmVo.getPhone())) {
            String code = (String)msmVo.getParam().get("code");
            return this.send(msmVo.getPhone(),code);
        }
        return false;

    }
}
